<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>转链</title>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1">
    <link rel="shortcut icon" href="/favicon.ico">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">

    <link rel="stylesheet" href="//g.alicdn.com/msui/sm/0.6.2/css/sm.min.css">
    <link rel="stylesheet" href="//g.alicdn.com/msui/sm/0.6.2/css/sm-extend.min.css">

</head>
<body>
<div class="page-group" >
    <div id="page-convert" class="page page-current" >
        <style>

        </style>
        <header class="bar bar-nav">
            <a class="button button-link button-nav pull-left back">
                <span class="icon icon-left"></span>
                返回
            </a>
            <h1 class='title'>链接转换</h1>
        </header>
        <div class="content">
            <div><p style="margin: 1em 1em 1em 1em">在下方输入手机淘宝中，商品对应的淘口令，即可获取该商品对应的优惠信息。<a href = "help.html">使用帮助</a></p></div>
            <div class="content-block">
                <div class="item-input">
                    <textarea id="content" style="background: #e8e8e8;border-radius: 10px;width: 100%;height: 15rem;font-size: 0.8rem;padding: 0.4rem;border:0"></textarea>
                </div>
                <div class="content-block">
                    <p><button class="button button-big button-round" style="width: 100%" onclick="getNumId()">转换</button></p>
                </div>
            </div>
        </div>

        <script type='text/javascript' src='//g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
        <script type='text/javascript' src='//g.alicdn.com/msui/sm/0.6.2/js/sm.min.js' charset='utf-8'></script>
        <script type='text/javascript' src='//g.alicdn.com/msui/sm/0.6.2/js/sm-extend.min.js' charset='utf-8'></script>
        <script src="https://cdn.bootcss.com/clipboard.js/2.0.4/clipboard.min.js"></script>
        <script src="js/common.js"></script>

        <script>
            function getNumId() {
                var url = baseUrl+"q/convert";
                var param = {
                    "tpwd":$("#content").val()
                };
                $.post(url,param,function (result) {
                    console.log(result);
                    if(result.code == 50000){
                        $.router.load("./details.html?itemId="+result.data);
                    }else {
                        //请求失败
                        $.toast(result.message);
                    }
                })
            }
        </script>
        <script src="js/pageRoute.js"></script>

    </div>
</div>

</body>
</html>